<template>
	<app-layout>
		<view class="mine tn-safe-area-inset-bottom">
			<!-- 顶部自定义导航 -->
			<tn-nav-bar > 人员信息</tn-nav-bar>

			<view class="top-backgroup" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
				<image src='../static/my-bg4.png' mode='widthFix' class='backgroud-image'>
				</image>
			</view>

			<view class="about__wrap" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
				<!-- 图标logo/头像 -->
				<view class="tn-flex tn-flex-col-center tn-flex-row-center tn-margin-xs tn-cat-shadow "
					style="margin-top: -450rpx;">
					<view class="  tn-text-center">
						<image class="logo-image" 	@click="prew" :src="xduser.face" mode="aspectFill"></image>
						<view class="tn-padding-top-sm">
							{{xduser.username}}
						</view>
					</view>
				</view>
				<!-- 我的信息 -->
				<view class="about-shadow tn-margin-top-lg tn-padding-bottom-xl tn-bg-white">
					<tn-list-view :card="true" unlined="all">
						<view slot="title" class="title tn-flex tn-flex-row-between">
							<view class="tn-text-bold">
								基本信息
							</view>
						</view>
						<block>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">姓名</view>
									</view>
									<view class="list__right">
										<view>{{xduser.username}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">毛发编号</view>
									</view>
									<view class="list__right">
										<view>{{xduser.mfid}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">性别</view>
									</view>
									<view class="list__right">
										<view>{{xduser.xb}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">出生年月</view>
									</view>
									<view class="list__right">
										<view>{{xduser.csrq}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">身份证号</view>
									</view>
									<view class="list__right">
										<view>{{xduser.sfz}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">联系电话</view>
									</view>
									<view class="list__right">
										<view>{{xduser.iphone}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">户籍地址</view>
									</view>
									<view class="list__right ">
										<view>{{xduser.province}}{{xduser.city}}{{xduser.county}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">详细地址</view>
									</view>
									<view class="list__right ">
										<view> {{xduser.street}}{{xduser.village}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell  v-if="xduser.provincejzd">
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">居住地址</view>
									</view>
									<view class="list__right ">
										<view>{{xduser.provincejzd}}{{xduser.cityjzd}}{{xduser.countyjzd}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell v-if="xduser.streetjzd">
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">详细地址</view>
									</view>
									<view class="list__right ">
										<view> {{xduser.streetjzd}}{{xduser.villagejzd}}{{xduser.jzd}} </view>
									</view>
								</view>
							</tn-list-cell>

							<tn-list-cell  v-if="xduser.onBlur">
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">工作单位</view>
									</view>
									<view class="list__right">
										<view>{{xduser.onBlur}}</view>
									</view>
								</view>
							</tn-list-cell>
						</block>
					</tn-list-view>
				</view>
				<!-- 管控信息 -->
				<view class="about-shadow tn-margin-top-lg tn-padding-bottom-xl tn-bg-white">
					<tn-list-view :card="true" unlined="all">
						<view slot="title" class="title tn-flex tn-flex-row-between">
							<view class="tn-text-bold">
								管控信息
							</view>
						</view>
						<block>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">管控乡镇</view>
									</view>
									<view class="list__right">
										<view>{{xduser.gsxz}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">管控社工</view>
									</view>
									<view class="list__right">
										<view>{{xduser.gssg}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">分级分类</view>
									</view>
									<view class="list__right">
										<view>{{xduser.fcfl}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">人员状态</view>
									</view>
									<view class="list__right">
										<view>{{xduser.ryzt}}</view>
									</view>
								</view>
							</tn-list-cell>
							<!-- #ifndef MP-WEIXIN -->
							<tn-list-cell v-if="xduser.csks && xduser.csjs">
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">管控周期</view>
									</view>
									<view class="list__right">
										<view>{{xduser.csks}}至{{xduser.csjs}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell v-if="xduser.njcsksnext && xduser.njcsjsend">
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">本期尿检</view>
									</view>
									<view class="list__right">
										<view>{{xduser.njcsksnext}}至{{xduser.njcsjsend}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell v-if="xduser.jfcsksnext && xduser.jfcsjsend">
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">本期走访</view>
									</view>
									<view class="list__right">
										<view>{{xduser.jfcsksnext}}至{{xduser.jfcsjsend}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell v-if="xduser.sfts!=1">
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">管控措施</view>
									</view>
									<view class="list__right">
										<view v-if="xduser.njzq!=xduser.jfzq">{{xduser.njzq}}、{{xduser.jfzq}}</view>
										<view v-else>{{xduser.njzq}}</view>
									</view>
								</view>
							</tn-list-cell>
							<!-- #endif-->
						</block>
					</tn-list-view>
				</view>

				<!-- 帮教小组 -->
				<template v-if="xduser.bjgroup&& xduser.bjgroup.length>0">
			
				<view class="about-shadow tn-margin-top-lg tn-padding-bottom-xl tn-bg-white" v-for="(mansw, index3) in xduser.bjgroup" :key="index3">
					<tn-list-view :card="true" unlined="all">
						<view slot="title" class="title tn-flex tn-flex-row-between">
							<view class="tn-text-bold">
								帮教小组-{{mansw.groupname}}
							</view>
						</view>
						<block >
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">{{mansw.username}}</view>
									</view>
									<view class="list__right">
										<view>{{mansw.iphone}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">帮教单位</view>
									</view>
									<view class="list__right">
										<view>{{mansw.unit}}</view>
									</view>
								</view>
							</tn-list-cell>
							
						</block>
					</tn-list-view>
				</view>
				</template>
				<!-- 涉毒情况 -->
				<view class="about-shadow tn-margin-top-lg tn-padding-bottom-xl tn-bg-white">
					<tn-list-view :card="true" unlined="all">
						<view slot="title" class="title tn-flex tn-flex-row-between">
							<view class="tn-text-bold">
								涉毒情况
							</view>
						</view>
						<block >
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">涉毒类型</view>
									</view>
									<view class="list__right">
										<view class="">{{xduser.lyzlStr}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">吸食方式</view>
									</view>
									<view class="list__right">
										<view class="">{{xduser.sucktypeStr}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">初次吸毒日期</view>
									</view>
									<view class="list__right">
										<view class="">{{xduser.ccfx}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">未次吸毒日期</view>
									</view>
									<view class="list__right">
										<view class="">{{xduser.lasttime}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">查获次数</view>
									</view>
									<view class="list__right">
										<view class="">{{xduser.chcs}}</view>
									</view>
								</view>
							</tn-list-cell>
						</block>
					</tn-list-view>
				</view>
				<!-- 查获情况 -->
				<template v-if="xduser.sdqklist&& xduser.sdqklist.length>0">
				<view class="about-shadow tn-margin-top-lg tn-padding-bottom-xl tn-bg-white" v-for="(item, index) in xduser.sdqklist" :key="index" >
					<tn-list-view :card="true" unlined="all" >
						<view slot="title" class="title tn-flex tn-flex-row-between">
							<view class="tn-text-bold">
								吸毒查获情况{{index+1}}
							</view>
						</view>
						<block >
							
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">涉毒类型</view>
									</view>
									<view class="list__right">
										<view>{{item.lyzlStr}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">查获时间</view>
									</view>
									<view class="list__right">
										<view>{{item.cctime}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">查获单位</view>
									</view>
									<view class="list__right">
										<view>{{item.ccs}}</view>
									</view>
								</view>
							</tn-list-cell>
						</block>
					</tn-list-view>
				</view>
				</template>
				<!-- 家属情况 -->
				<template v-if="xduser.jsgroup&& xduser.jsgroup.length>0">
				<view class="about-shadow tn-margin-top-lg tn-padding-bottom-xl tn-bg-white" v-for="(item2, index2) in xduser.jsgroup" :key="index2">
					<tn-list-view :card="true" unlined="all">
						<view slot="title" class="title tn-flex tn-flex-row-between">
							<view class="tn-text-bold">
								家属情况{{index2+1}}
							</view>
						</view>
						<block >
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">家属关系</view>
									</view>
									<view class="list__right">
										<view>{{item2.relation}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">家属姓名</view>
									</view>
									<view class="list__right">
										<view>{{item2.username}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">家属现居住地</view>
									</view>
									<view class="list__right">
										<view>{{item2.house}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">家属工作单位</view>
									</view>
									<view class="list__right">
										<view>{{item2.unit}}</view>
									</view>
								</view>
							</tn-list-cell>
							<tn-list-cell>
								<view class="list-icon-text">
									<view class="list__left">
										<view class="list__left__text">家属电话</view>
									</view>
									<view class="list__right">
										<view>{{item2.iphone}}</view>
									</view>
								</view>
							</tn-list-cell>
						</block>
					</tn-list-view>
				</view>
				</template>
			
			</view>


			<view class='tn-tabbar-height'></view>

		</view>
	</app-layout>
</template>

<script>
	export default {
		name: 'Home',
		data() {
			return {
				mfid: '',
				xduser: ''
			}
		},
		onLoad(options) {
			this.mfid = options.mfid ? options.mfid : this.mfid;
		},
		onShow() {
			//获取在册人员信息
			this.getxduser()
		},
		methods: {
			// 跳转
			tn(e) {
				uni.navigateTo({
					url: e,
				});
			},
			prew() {
				uni.previewImage({
					urls: [this.xduser.face]
				})
			},

			//获取在册人员信息
			getxduser() {
				let t = this;
				this.$t.message.loading('加载中');
				this.$request({
					url: this.$api.xduser.info,
					data: {
						mfid: t.mfid
					},
					method: 'POST'
				}).then(response => {
					this.$t.message.closeLoading();
					if (response.code === 0) {
						t.xduser = response.info;
					}
					this.$t.message.closeLoading();
				});
			},
		}

	}
</script>

<style lang="scss" scoped>
	.box {
		padding: 15rpx;

	}
	.list__left{
		min-width: 180rpx;
	}
	/* 底部安全边距 start*/
	.tn-tabbar-height {
		min-height: 120rpx;
		height: calc(140rpx + env(safe-area-inset-bottom) / 2);
		height: calc(140rpx + constant(safe-area-inset-bottom));
	}

	.tn-color-cat {
		color: #1D2541;
	}

	.tn-bg-cat {
		background-color: #1D2541;
	}

	.tn-margin-xs1 {
		min-width: 170rpx;
	}

	.title {
		padding: 26rpx 30rpx;
	}

	/* 自定义导航栏内容 start */
	.custom-nav {
		height: 100%;

		&__back {
			margin: auto 5rpx;
			font-size: 40rpx;
			margin-right: 10rpx;
			flex-basis: 5%;
			width: 100rpx;
			position: absolute;
		}
	}



	/* 用户头像 start */
	.logo-image {
		width: 200rpx;
		height: 200rpx;
		position: relative;
		overflow: hidden;
		border-radius: 50%;
	}



	/* 页面 start*/
	.about-shadow {
		border-radius: 15rpx;
		box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
	}

	.about {

		&__wrap {
			position: relative;
			z-index: 1;
			margin: 20rpx 30rpx;
		}
	}

	/* 页面 end*/


	/* 图标容器12 start */
	.icon12 {
		&__item {
			width: 30%;
			background-color: #FFFFFF;
			border-radius: 10rpx;
			padding: 30rpx;
			margin: 20rpx 10rpx;
			transform: scale(1);
			transition: transform 0.3s linear;
			transform-origin: center center;

			&--icon {
				width: 15rpx;
				height: 15rpx;
				font-size: 40rpx;
				border-radius: 50%;
				margin-bottom: 38rpx;
				position: relative;
				z-index: 1;

				&::after {
					content: " ";
					position: absolute;
					z-index: -1;
					width: 100%;
					height: 100%;
					left: 0;
					bottom: 0;
					border-radius: inherit;
					opacity: 1;
					transform: scale(1, 1);
					background-size: 100% 100%;

				}
			}
		}
	}

	/* 图标容器1 start */
	.icon1 {
		&__item {
			// width: 30%;
			background-color: #FFFFFF;
			border-radius: 10rpx;
			padding: 30rpx;
			margin: 20rpx 10rpx;
			transform: scale(1);
			transition: transform 0.3s linear;
			transform-origin: center center;

			&--icon {
				width: 40rpx;
				height: 40rpx;
				font-size: 40rpx;
				border-radius: 50%;
				position: relative;
				z-index: 1;

				&::after {
					content: " ";
					position: absolute;
					z-index: -1;
					width: 100%;
					height: 100%;
					left: 0;
					bottom: 0;
					border-radius: inherit;
					opacity: 1;
					transform: scale(1, 1);
					background-size: 100% 100%;
				}
			}
		}
	}

	/* 图标容器1 end */



	.list {
		&__left {
			display: flex;
			align-items: center;
			justify-content: flex-start;

			&__icon,
			&__image {
				margin-right: 18rpx;
			}
		}

		&__right {
			display: flex;
			align-items: center;
			justify-content: flex-end;
		}
	}

	.list-icon-text,
	.list-image-text {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	/* 顶部背景图 start */
	.top-backgroup {
		height: 450rpx;
		z-index: -1;

		.backgroud-image {
			width: 100%;
			height: 450rpx;
			// z-index: -1;
		}
	}

	/* 顶部背景图 end */
</style>